package com.wcy.feign.user;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wcy.entity.UserComment;
import com.wcy.entity.pageVo.ApiDescriptor;
import com.wcy.entity.pageVo.ColumnConstructor;
import com.wcy.entity.pageVo.PageData;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.List;
import java.util.Objects;

@FeignClient(name = "cloud-provider-user", contextId = "FeignUserCommentService")
public interface FeignUserCommentService {
    @GetMapping("userComment/page")
    public ResponseEntity<Page<UserComment>> getPage(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                     @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);

    @GetMapping("userComment/list")
    public ResponseEntity<List<UserComment>> getList();

    @PostMapping("userComment/add")
    public ResponseEntity<Void> add(@RequestBody UserComment userComment);

    @PutMapping("userComment/update")
    public ResponseEntity<Void> update(@RequestBody UserComment userComment);
    @DeleteMapping("userComment/delete/{id}")
    public ResponseEntity<Void> delete(@PathVariable("id") Integer id);
    @GetMapping("userComment/resource/{id}")
    public ResponseEntity<Page<UserComment>> getByResourceIdPage(@PathVariable("id") Integer id,
                                                                 @RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                                 @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);
    @GetMapping("userComment/user")
    public ResponseEntity<Page<UserComment>> getBySelf(@RequestParam(name = "pageNum",defaultValue = "1") int pageNum,
                                                             @RequestParam(name = "pageSize",defaultValue = "10") int pageSize);

    @PostMapping("userComment/sendComment")
    public ResponseEntity<Void> sendComment(@RequestBody UserComment userComment);

    @DeleteMapping("userComment/user/delete/{id}")
    public ResponseEntity<Void> deleteByUser(@PathVariable("id") Integer id);

    @PostMapping("userComment/byResourceId/page")
    public ResponseEntity<Page<UserComment>> getByResourceIdsPage(@RequestParam(value = "pageNum",defaultValue = "1") int pageNum,
                                                               @RequestParam(value = "pageSize",defaultValue = "10") int pageSize,
                                                                  @RequestParam("resourceIds") List<Integer> resourceIds);
}
